package com.colde.salary.serviceImpl;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;

import com.colde.salary.dao.BaseMapper;
import com.colde.salary.service.IBaseService;

/**
 * 不能用@Service注解，会报single but find two之类的错误
 * @author Colde
 *
 * @param <M>
 * @param <T>
 */
public  class BaseServiceImpl<M extends BaseMapper<T>,T> implements IBaseService<T>{

	@Autowired
	protected  M baseMapper;
	
	@Override
	public List<T> select(T record) {
		return baseMapper.select(record);
	}

	@Override
	public int selectCount(T record) {
		return baseMapper.selectCount(record);
	}

	@Override
	public T selectByPrimaryKey(Object key) {
		return baseMapper.selectByPrimaryKey(key);
	}

	@Override
	public int insert(T record) {
		return baseMapper.insert(record);
	}

	@Override
	public int insertSelective(T record) {
		return baseMapper.insertSelective(record);
	}

	@Override
	public int delete(T record) {
		return baseMapper.delete(record);
	}

	@Override
	public int deleteByPrimaryKey(Object key) {
		return baseMapper.deleteByPrimaryKey(key);
	}

	@Override
	public int updateByPrimaryKey(T record) {
		return baseMapper.updateByPrimaryKey(record);
	}

	@Override
	public int updateByPrimaryKeySelective(T record) {
		return baseMapper.updateByPrimaryKeySelective(record);
	}

	@Override
	public T selectOne(T record) {
		return baseMapper.selectOne(record);
	}

}
